/* eslint-disable */
import request from '@/utils/request'
// 列表
export function fetchList(url,params) {
    console.log(url);
    return request({
        url: url,
        method: 'get',
        params
    })
}
export function fetchGet(url) {
    return request({
        url: url,
        method: 'get',
    })
}
// 添加
export function createOne(url,data) {
    return request({
        url: url,
        method: 'post',
        data
    })
}
// 修改
export function updateOne(url,data) {
    return request({
        url: url+'/'+data.id,
        method: 'put',
        data
    })
}
export function updateOneNoId(url,data) {
    return request({
        url: url,
        method: 'put',
        data
    })
}
// 修改局部 /wallets/recharge
export function updatePatch(url,data) {
    return request({
        url: url,
        method: 'patch',
        data
    })
}
// 删除
export function deleteOne(url,data) {
    return request({
        url: url+'/'+data.id,
        method: 'delete'
    })
}
export function deleteOnePut(url,id) {
  return request({
    url: url+'/'+id,
    method: 'put'
  })
}
// 获取详细
export function getOne(url,data) {
    return request({
        url: url+'/'+data.id,
        method: 'get',
        data
    })
}
/*
获取详细信息
 */
export function getInfo(url,id) {
    return request({
        url: url+'/'+id+'/info',
        method: 'get',
    })
}

export function getAll(url) {
    return request({
        url: url,
        method: 'get'
    })
}

//所有公司
export function companyAll() {
    return request({
        url: 'auth/companies/all',
        method: 'get'
    })
}
//角色all信息
export function rolesAll() {
    return request({
        url: 'auth/roles/all',
        method: 'get'
    })
}
//地区信息
export function areasAll() {
    return request({
        url: 'auth/areas/all',
        method: 'get'
    })
}
//某公司部门信息
export function departAll(id) {
    return request({
        url: `auth/companies/${id}/departments/all`,
        method: 'get'
    })
}
//某公司部门信息
export function positionAll(id) {
    return request({
        url: `auth/companies/${id}/positions/all`,
        method: 'get'
    })
}
//某公司员工
export function userAll(id) {
    return request({
        url: `auth/companies/${id}/users/all`,
        method: 'get'
    })
}
//定义流程
export function flowAll(id) {
    return request({
        url: `flowable/dy/all`,
        method: 'get'
    })
}
//
export function postByQuery(url,params) {
    return request({
        url: url,
        method: 'post',
        data: params
    });
}
export function uploadImg(uploadUrl,file) {
    //todo
    return request({
        // url: 'commodities/all',
        // method: 'get'
    })
}
